package com.jsle.financial.domain;

import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.jsle.financial.util.JsonDateSerializer;

/**
 * 通用数据实体
 * 
 * @Title: DataEntity.java
 * @Description: <br>
 * <br>
 * @Created on Nov 11, 2012 6:33:58 AM
 * @author lixbh
 * @version $Revision: 1.1.2.2 $
 * @since 1.0
 */
public class DataEntity implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 公司
     */
    private String company;

    /**
     * 日期
     */
    @JsonSerialize(using = JsonDateSerializer.class)
    private Date accdate;

    /**
     * 类型，一收入下滑仪表，二资金短缺仪表等
     */
    private String type;

    /**
     * 项目名称
     */
    private String itemName;

    /**
     * 本期数值
     */
    private Double itemValue;

    public DataEntity() {
	// TODO Auto-generated constructor stub
    }

    public DataEntity(Date accdate, String type, String itemName,
	    Double itemValue) {
	super();
	this.accdate = accdate;
	this.type = type;
	this.itemName = itemName;
	this.itemValue = itemValue;
    }

    public Integer getId() {
	return id;
    }

    public void setId(Integer id) {
	this.id = id;
    }

   
    public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public Date getAccdate() {
	return accdate;
    }

    public void setAccdate(Date accdate) {
	this.accdate = accdate;
    }

    public String getType() {
	return type;
    }

    public void setType(String type) {
	this.type = type;
    }

    public String getItemName() {
	return itemName;
    }

    public void setItemName(String itemName) {
	this.itemName = itemName;
    }

    public Double getItemValue() {
	return itemValue;
    }

    public void setItemValue(Double itemValue) {
	this.itemValue = itemValue;
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((accdate == null) ? 0 : accdate.hashCode());
	result = prime * result + ((company == null) ? 0 : company.hashCode());
	result = prime * result
	        + ((itemName == null) ? 0 : itemName.hashCode());
	result = prime * result
	        + ((itemValue == null) ? 0 : itemValue.hashCode());
	result = prime * result + ((type == null) ? 0 : type.hashCode());
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (!(obj instanceof DataEntity))
	    return false;
	DataEntity other = (DataEntity) obj;
	if (accdate == null) {
	    if (other.accdate != null)
		return false;
	} else if (!accdate.equals(other.accdate))
	    return false;
	if (company == null) {
	    if (other.company != null)
		return false;
	} else if (!company.equals(other.company))
	    return false;
	if (itemName == null) {
	    if (other.itemName != null)
		return false;
	} else if (!itemName.equals(other.itemName))
	    return false;
	if (itemValue == null) {
	    if (other.itemValue != null)
		return false;
	} else if (!itemValue.equals(other.itemValue))
	    return false;
	if (type == null) {
	    if (other.type != null)
		return false;
	} else if (!type.equals(other.type))
	    return false;
	return true;
    }
}
